package org.jash.sportnews2109.vm

import androidx.lifecycle.MutableLiveData
import dagger.hilt.android.lifecycle.HiltViewModel
import org.jash.common.mvvm.BaseViewModel
import org.jash.sportnews2109.dao.VideoDao
import org.jash.sportnews2109.entity.Video
import javax.inject.Inject

@HiltViewModel
class PlayerViewModel @Inject constructor(val videoDao: VideoDao):BaseViewModel() {
    val videoLiveData by lazy { MutableLiveData<Video>() }
    fun loadVideo(id:Int) {
        progress(videoDao.findById(id), videoLiveData::postValue)
    }
}